import request from '@/utils/request'


export function getAllMajorsByPageAPI(params) {
  return request({
    url: '/majors/getAllMajorsByPage',
    params
  })
}
export function exportExcelAPI(params) {
  return request({
    url: '/majors/exportExcel',
    method: 'GET',
    responseType: 'blob', 
    params
  });
}

export function getAllMajorsAPI() {
  return request({
    url: '/majors/getAllMajors',
  })
}

export function addOrEditMajorAPI(majorDto) {
  return request({
    url: '/majors/addOrEditMajor',
    method: 'post',
    data: majorDto
  })
}

export function deleteMajorAPI(majorId){
  return request({
    url:`/majors/deleteMajor/${majorId}`,
    method: 'delete'
  })
}